package com.program.cloudmanage.tripteam.service;

import com.program.cloudmanage.tripteam.domain.Exit;
import com.program.cloudmanage.tripteam.persistence.ExitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExitService {
     @Autowired
    private ExitMapper exitMapper;
     public ExitService (){}
    public List<Exit> showExits(){
        return exitMapper.showExit();
    }
    public Exit searchExitByTeamId(String teamId){
         return exitMapper.searchExitByTeamId(teamId);
    }
    public Exit  searchExit(String exitId){
         return exitMapper.showExitById(exitId);
    }
    public void insertExit(Exit exit){
        exitMapper.insertExit(exit.getExitid(),exit.getTeamid(),exit.getStatus(),exit.getLegal(),exit.getLocation(),exit.getExpirationdate(),exit.getStarttime(),exit.getEndtime(),exit.getCost());
    }
    public void deleteExit(String exitid)
    {
        exitMapper.deleteExit(exitid);
    }
    public void updateExit(Exit exit){ exitMapper.updateExit(exit.getExitid(),exit.getStatus(),exit.getLegal(),exit.getLocation(),exit.getExpirationdate(),exit.getStarttime(),exit.getEndtime(),exit.getCost()); }
}
